//
//  updateDeviceCMDDicRequest.m
//  TestGizWits
//
//  Created by JM on 15/11/18.
//  Copyright © 2015年 JM. All rights reserved.
//

#import "updateDeviceCMDDicRequest.h"

@implementation updateDeviceCMDDicRequest
- (void)didRealRequest {
    [XPGWifiSDK updateDeviceFromServer:self.DY_productKey];
}

- (void)XPGWifiSDK:(XPGWifiSDK *)wifiSDK didUpdateProduct:(NSString *)product result:(int)result
{
    if(![product isEqualToString:self.DY_productKey])
    {
        self.block(nil,[NSError dy_errorWithErrCode:-999 errMessage:@"更新设备不匹配"]);
        return;
    }
    if(result == XPGWifiError_NONE) {
        updateDeviceCMDDicResponse* response = [updateDeviceCMDDicResponse response];
        response.DY_wifiSDK = wifiSDK;
        self.block(response,nil);
    }
    else
    {
        self.block(nil,[NSError dy_errorWithErrCode:result]);
    }
    [super superHandelResponse];
}

@end

@implementation updateDeviceCMDDicResponse

@end